﻿#region

using System.Collections.Generic;

#endregion

namespace Lab.Server.Domain {
    public class Employer {
        public int Id { get; set; }
        public string Name { get; set; }
        public string Address { get; set; }
        public string TelephoneNumber { get; set; }
        public List<KindOfActivity> KindOfActivities { get; set; }

        public void Validate() {
            if (string.IsNullOrEmpty(Name)) {
                throw new BusinessException("Empty employer name");
            }
            if (KindOfActivities == null || KindOfActivities.Count == 0) {
                throw new BusinessException("Employer have no kind of activity");
            }
        }
    }
}